﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CRM.upload
{
    public class UploadHandler : IHttpHandler
    {
        public bool IsReusable
        {
            get { return false; }
        }

        public void ProcessRequest(HttpContext context)
        {

            if (context.Request.Files.Count >= 1 && context.Request.Files[0] != null && context.Request.Files[0].ContentLength != 0)
            {
                context.Request.Files[0].SaveAs(context.Server.MapPath("~/upload") + "/" + context.Request.Files[0].FileName);
            }
        }
    }
}